import requests

# 根据协议类型，选择不同的代理
#proxies = {"socks5": "socks5://0.0.0.0:1080",
    #    'socks4': '127.0.0.1:1080',
     #   'https': '127.0.0.1:1080',
      #  'http': '127.0.0.1:1080',
       # }

proxies = {'http': 'socks5h://0.0.0.0:1080',
        'https': 'socks5h://0.0.0.0:1080'}
headers = {
            'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'
            }
#response = requests.get("https://www.baidu.com", proxies = proxies, verify=False)
#response = requests.get("https://zh.wikipedia.org/wiki/Fuck", proxies = proxies, headers=headers)
response = requests.get("https://twitter.com/", headers=headers, proxies=proxies)
with open('baidu.html', 'wb') as f:
    f.write(response.content)
